<template>
	<view>
		<view class="white">
			<view class="feedBack-title">{{feedBackData.title}}</view>
			<views class="feedBack-content">{{feedBackData.content}}</views>
			<view class="img-row">
				<view v-for="(item,index) in feedBackData.images" :key="index" @click="catImage(index)">
					<image :src="item.url" class="image" mode="aspectFill"> </image>
				</view>
			</view>
			<view class="text-time">{{feedBackData.createTime}}提交</view>

		</view>
		<view class="box">
			<view class="text-black">客服回复：</view>
			<view class="text-grey">您的反馈我们已经收到，我们会尽快处理并给您回复，给您造成的不便敬请谅解。感谢您的反馈与支持！</view>
			<view class="text-time">{{feedBackData.createTime}}</view>
		</view>

		<view class="box" v-if="feedBackData.reply">
			<view class="text-black">客服回复：</view>
			<view class="text-grey">{{feedBackData.reply}}</view>
			<view class="text-grey" style="margin-top: 20rpx;">是否解决了您的问题</view>
			<view class="flex-row">
				<view @click="resolve(true)" :class="isResolve&&isShow?'btn-resolve':'btn-normal'" class="btn-normal">
					<i class="zi zi_digg" :style="isResolve&&isShow ? 'color: #19CFB7;' : ''"></i>
					已解决
				</view>
				<view @click="resolve(false)" :class="!isResolve&&isShow?'btn-unResolve':'btn-normal'"
					class="btn-normal">
					<i class="zi zi_oppose" :style="!isResolve&&isShow ? 'color: #FF5F5F;' : ''"></i>
					未解决
				</view>
			</view>
			<view class="text-time">{{feedBackData.updateTime}}</view>
		</view>

		<view class="box" v-if="feedBackData.reply&&isResolve&&isShow">
			<view class="text-black">客服回复：</view>
			<view class="text-grey">尊敬的用户您好，很高兴我们的答案能帮助到您。感谢您的支持!</view>
		</view>

		<view class="box" v-if="feedBackData.reply&&!isResolve&&isShow">
			<view class="text-black">客服回复：</view>
			<view class="text-grey">尊敬的用户您好，对于我们的答案没有帮助到您，我们感到十分抱歉。建议您详细描述您遇到的问题并重新提交意见反馈或者拨打客服电话继续咨询，感谢您的支持!</view>
		</view>

		<view></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				feedBackData: {
					"createTime": "2022-03-07 11:31:51",
					"updateTime": "2022-03-07 11:31:51",
					"title": "界面显示错乱",
					"content": "华为P30手机进入，偶尔展示错乱，很是奇怪，刷新后就没啥事情了",
					"images": [{
						"name": "lady.png",
						"url": "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-7357b34b-3ac3-489b-abd2-dfaf71fbb231/6f9c65d5-9a15-4704-8fbc-886144e6f341.jpg"
					}, {
						"name": "man.png",
						"url": "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-7357b34b-3ac3-489b-abd2-dfaf71fbb231/6a0d765c-3a9a-462c-93f9-513ba0b03f57.jpg"
					}],
					"state": "1",
					"stateName": "已回复",
					"reply": "尊敬的用户您好，对于您反馈的问题我们深感抱歉，后期会做好各个页面的适配工作，让您用的舒心。感谢您的支持"
				},
				isResolve: false,
				isShow: false
			}
		},
		methods: {
			resolve(isResolve) {
				if (!this.isShow) {
					this.isResolve = isResolve
					this.isShow = true;
				}


			},
			catImage(index) {
				uni.navigateTo({
					url: '/pages/common/showImage/showImage?imgs=' + JSON.stringify(this.feedBackData.images) +
						'&current=' +
						index,
					animationType: "fade-in",
				})
			}



		}
	}
</script>

<style>
	page {
		background-color: #F8F8F8;
		padding-bottom: 30rpx;
	}

	.white {
		background-color: #FFFFFF;
		padding: 45rpx 40rpx;
		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
	}

	.text-grey {
		color: #606266;
		font-size: 32rpx;
		line-height: 1.5em;
	}

	.text-time {
		color: #909193;
		font-size: 24rpx;
		text-align: end;
		margin-top: 30rpx;
	}

	.text-black {
		color: #303133;
		font-size: 32rpx;
		margin-bottom: 30rpx;
		font-weight: bold;
	}

	.feedBack-title {
		color: #303133;
		font-size: 32rpx;
		margin-bottom: 15rpx;
		font-weight: bold;
	}

	.feedBack-content {
		margin-top: 5rpx;
		font-size: 15rpx;
		color: #303133;
	}

	.box {
		background-color: #FFFFFF;
		border-radius: 30rpx;
		margin: 50rpx 30rpx;
		padding: 30rpx 30rpx;
	}

	.icon-normal {
		width: 25rpx;
		height: 25rpx;
		margin-right: 20rpx;
	}


	.flex-row {
		display: flex;
		flex-direction: row;
		justify-content: space-around;
		align-items: center;
		margin-top: 30rpx;
	}

	.btn-normal {
		border-radius: 40rpx;
		border: solid 1rpx #D2D2D2;
		color: #999999;
		padding: 20rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 28rpx;
		width: 32%;
	}

	.btn-resolve {
		background-color: #E1FFFB;
		border: solid 1rpx #19CFB7;
		color: #19CFB7;

	}

	.btn-unResolve {
		border: solid 1rpx #FF5F5F;
		background-color: #FFF2F2;
		color: #FF5F5F;

	}



	.image {
		width: 200rpx;
		height: 200rpx;
		border-radius: 20rpx;
		margin: 10rpx;
	}

	.img-row {
		display: flex;
		flex-direction: row;

		flex-wrap: wrap;
		justify-content: flex-start;
		align-items: center;

	}
</style>